import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int count=0;
        for(int i=1;i<=N;i++){
            if(findNum(i)){
                count++;
            }
        }
        System.out.println(count);
    }
    public static boolean findNum(int num){
        String str=Integer.toString(num);
        char[] ch=str.toCharArray();
        for(int i=ch.length-1;i>=0;i--){
            if(!(((ch.length-i)%2==0&&ch[i]%2==0)||(ch.length-i)%2==1&&ch[i]%2==1)){
                return false;
            }
        }
        return true;
    }
}